import service from '@/utils/request'

// @Tags CustomerInfo
// @Summary 创建客户资料
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.CustomerInfo true "创建客户资料"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
// @Router /customerInfo/createCustomerInfo [post]
export const createCustomerInfo = (data) => {
  return service({
    url: '/customerInfo/createCustomerInfo',
    method: 'post',
    data
  })
}

// @Tags CustomerInfo
// @Summary 删除客户资料
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.CustomerInfo true "删除客户资料"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /customerInfo/deleteCustomerInfo [delete]
export const deleteCustomerInfo = (params) => {
  return service({
    url: '/customerInfo/deleteCustomerInfo',
    method: 'delete',
    params
  })
}

// @Tags CustomerInfo
// @Summary 批量删除客户资料
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.IdsReq true "批量删除客户资料"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /customerInfo/deleteCustomerInfo [delete]
export const deleteCustomerInfoByIds = (params) => {
  return service({
    url: '/customerInfo/deleteCustomerInfoByIds',
    method: 'delete',
    params
  })
}

// @Tags CustomerInfo
// @Summary 更新客户资料
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.CustomerInfo true "更新客户资料"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
// @Router /customerInfo/updateCustomerInfo [put]
export const updateCustomerInfo = (data) => {
  return service({
    url: '/customerInfo/updateCustomerInfo',
    method: 'put',
    data
  })
}

// @Tags CustomerInfo
// @Summary 用id查询客户资料
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query model.CustomerInfo true "用id查询客户资料"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /customerInfo/findCustomerInfo [get]
export const findCustomerInfo = (params) => {
  return service({
    url: '/customerInfo/findCustomerInfo',
    method: 'get',
    params
  })
}

// @Tags CustomerInfo
// @Summary 分页获取客户资料列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query request.PageInfo true "分页获取客户资料列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /customerInfo/getCustomerInfoList [get]
export const getCustomerInfoList = (params) => {
  return service({
    url: '/customerInfo/getCustomerInfoList',
    method: 'get',
    params
  })
}

export const getCustomerInfoListAndBrands = () => {
  return service({
    url: '/CustomerInfo/get_customerInfo_getCustomerInfoList',
    method: 'get',
    params
  })
}
// 同步
export const syncCustomerInfo = (data) => {
  return service({
    url: '/customerInfo/syncCustomerInfo',
    method: 'put',
    data
  })
}